package com.example.designpatterns.creational.factory;

/**
 * @author zuitu@foxmail.com
 * @date 2024/1/19
 */
public class ShapeFactory {
    public Shape getShape(String shapeType){
        if(shapeType == null){
            return new NoShape();
        }
        if(shapeType.equalsIgnoreCase("CIRCLE")){
            return new Circle();
        } else if(shapeType.equalsIgnoreCase("RECTANGLE")){
            return new Rectangle();
        } else if(shapeType.equalsIgnoreCase("SQUARE")){
            return new Square();
        }
        return new NoShape();
    }
}
